<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Module robber</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<hr>

<h1>Module robber</h1>
<ul class="index"><li><a href="#description">Description</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>The Robber Agent decides which tile to place the robber on when the AI throws a seven
  or if it play a Knight card.


<h2><a name="description">Description</a></h2>The Robber Agent decides which tile to place the robber on when the AI throws a seven
  or if it play a Knight card. To do this it communicate with all nodes to get information
  about the placement of the opponents settlements and cities.
<h2><a name="index">Function Index</a></h2>
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#getBestTile-3">getBestTile/3</a></td><td>Goes through all possible tiles and
  returns the tile number that have the highest scale value.</td></tr>
<tr><td valign="top"><a href="#getNodes-2">getNodes/2</a></td><td>Sends a msg to all nodes around the current tile, asking for Owner and Type
  Returns a list with this information.</td></tr>
<tr><td valign="top"><a href="#getP_Tiles-4">getP_Tiles/4</a></td><td>Checks which tiles that it's possible to put the robber on.</td></tr>
<tr><td valign="top"><a href="#init-0">init/0</a></td><td>The init function spawns the robber agent.</td></tr>
</table>

<h2><a name="functions">Function Details</a></h2>

<h3 class="function"><a name="getBestTile-3">getBestTile/3</a></h3>
<div class="spec">
<p><tt>getBestTile(BestScale::BestValue, P_Tiles::Tiles, Tile::BestTileSoFar) -&gt; TileNr</tt></p>
</div><p>Goes through all possible tiles and
  returns the tile number that have the highest scale value</p>

<h3 class="function"><a name="getNodes-2">getNodes/2</a></h3>
<div class="spec">
<p><tt>getNodes(Nr::CurrentTileNumber, Nodes::NodeIDs) -&gt; [{Owner, Type}]</tt></p>
</div><p>Sends a msg to all nodes around the current tile, asking for Owner and Type
  Returns a list with this information</p>

<h3 class="function"><a name="getP_Tiles-4">getP_Tiles/4</a></h3>
<div class="spec">
<p><tt>getP_Tiles(Tiles, Nodes::NodeIDs, Robber_Pos, P_Tiles::PossiblePlacment) -&gt; [Tiles]</tt></p>
</div><p>Checks which tiles that it's possible to put the robber on.
  If it is possible, then it will calculate a scale value based
  on how many settlements/cities are connected to the tile and
  how many players.</p>

<h3 class="function"><a name="init-0">init/0</a></h3>
<div class="spec">
<p><tt>init() -&gt; Pid</tt></p>
</div><p>The init function spawns the robber agent</p>
<hr>

<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc, May 20 2011, 17:27:19.</i></p>
</body>
</html>
